package com.cw.common.method;

public class CommonMethod {
    //附二院备注处理
    public String RemarkExtend(String remark)
    {
        remark = remark.replace(" ","");
        remark = remark.replace("1.","");
        remark = remark.replace("2.","");
        remark = remark.replace("三香路院区：苏州市姑苏区三香路1055号","");
        remark = remark.replace("浒关院区：苏州市高新区浒墅关镇康复弄28号","");
        remark = remark.replace("异地医保患者请先至参保地备案后办理入院","【3】");
        remark = remark.replaceAll("\\n","");
        if(remark.equals("【3】"))
        {
            remark ="";
        }
        else if(!remark.contains("【3】"))
        {
            remark =String.join("","【3】",remark);
        }
        return remark;
    }

    /**
     * 床位名称
     */
    public String getBedName(String bedNo) {
        String ret = "";
        String subBedNo = bedNo.substring(5); //截取第五位开始
        try {
            int intBedNo = Integer.parseInt(subBedNo); //返回截取字段的十进制
            ret = String.valueOf(intBedNo);  //返回intBedNo的一个实例
        } catch (Exception ex) {
            ret = subBedNo;   //将subBedNo赋值给ret
        }
        return ret;  //返回
    }

}
